﻿using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace TestFilterSocket
{
    public class HansReceiveFilterFactory : IReceiveFilterFactory<HansRequestInfo>, IReceiveFilterFactory
    {
        public Encoding Encoder = Encoding.GetEncoding("gbk");

        public string StartMark = "!Start";

        public string EndMark = "$End";

        public HansReceiveFilterFactory(Encoding encoder, string startMark, string endMark)
        {
            this.Encoder = encoder;
            this.StartMark = startMark;
            this.EndMark = endMark;
        }

        public IReceiveFilter<HansRequestInfo> CreateFilter(IAppServer appServer, IAppSession appSession, IPEndPoint remoteEndPoint)
        {
            return new HansReceiveFilter(this.Encoder, this.StartMark, this.EndMark);
        }
    }
}
